-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix(eos_cli_config_gen,eos_designs): Dont configure access group on interface when access group is defined on session level #4565
Conversation
Review docs on Read the Docs To test this pull request: # Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-4565
# Activate the virtual environment
source test-avd-pr-4565/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/laxmikantchintakindi/avd.git@bug/monitor-session#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/laxmikantchintakindi/avd.git#/ansible_collections/arista/avd/,bug/monitor-session --force
# Optional: Install AVD examples
cd test-avd-pr-4565
ansible-playbook arista.avd.install_examples |
6e29ef7
to
764e6b8
Compare
ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/DC1-SVC3A.cfg
Show resolved
Hide resolved
python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/monitor-sessions.j2
Outdated
Show resolved
Hide resolved
Can I update eos_designs for monitor_sesion with this logic? |
Sure, then update the scope on PR title to be both roles. |
9605bfd
to
851b365
Compare
Fixed. |
python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/monitor_sessions.py
Outdated
Show resolved
Hide resolved
aa1fabf
to
759c909
Compare
9241028
to
fb6c163
Compare
python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/monitor_sessions.py
Outdated
Show resolved
Hide resolved
074d900
to
dff376d
Compare
…n access group is defined on session level
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
8175268
to
d141bdf
Compare
...collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/monitor-sessions.md
Show resolved
Hide resolved
Would it be useful to have a 3rd negative test case where part of the config is coming from loopback_ipv4_pool: 192.168.1.0/24
type: l2leaf
l2leaf:
defaults:
nodes:
- name: connected-endpoints-monitor-session-connected-endpoint-network-port-acl
servers:
- name: INDIVIDUAL_1
adapters:
- switches: [connected-endpoints-monitor-session-connected-endpoint-network-port-acl]
switch_ports: [Ethernet14]
description: Monitor Ethernet 14
monitor_sessions:
- name: DMF
role: source
session_settings:
access_group:
type: ip
name: acl1
network_ports:
- switches:
- connected-endpoints-monitor-session-connected-endpoint-network-port-acl
switch_ports:
- Ethernet14
description: PC
monitor_sessions:
- name: DMF
role: source
source_settings:
access_group:
type: ip
name: acl2
expected_error_message: >-
Cannot set an ACL for both `session_settings` and `source_settings` under the monitor session 'DMF'
for network_ports[0].
TASK [arista.avd.eos_designs : Generate device configuration in structured format] ***
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: pyavd._errors.AristaAvdInvalidInputsError: Cannot set an ACL for both `session_settings` and `source_settings` under the monitor session 'DMF' for network_ports[0].
fatal: [connected-endpoints-monitor-session-connected-endpoint-network-port-acl -> localhost]: FAILED! => {"changed": false, "msg": "Cannot set an ACL for both `session_settings` and `source_settings` under the monitor session 'DMF' for network_ports[0]."}
TASK [Assert eos_designs failed with the expected error message] ***************
ok: [connected-endpoints-monitor-session-connected-endpoint-network-port-acl] => {
"changed": false,
"msg": "All assertions passed"
} |
To not add too many tests for corner cases, this scenario could be the only one, since it would work the same no matter where the config is coming from. |
Quality Gate passedIssues Measures |
@alexeygorbunov remember to use |
…nterface when access group is defined on session level (aristanetworks#4565)
Change Summary
Dont configure access group to interface when access group is defined on session level
Related Issue(s)
Fixes #4524
Component(s) name
arista.avd.eos_cli_config_gen
arista.avd.eos_designs
Proposed changes
Dont configure access group to interface when access group is defined on session level
How to test
Checklist
User Checklist
Repository Checklist